package models

type Partner struct {
	PartnerId int
	Name string
	Pic string
	PartnerDesc string
	Url string
	Sort int
	Status int
	OperatorId int
	CreateTime string
}

func (Partner) TableName() string {
	return "partner"
}

func GetPartners(params interface{}) (partners []Partner) {
	db.Where(params).Order("sort asc", true).Limit(12).Find(&partners)
	return
}

func GetPartnersTest() (partners []Partner) {
	db.Where("Status = ?", 1).Where("Url like ?", "%www%").Where("Sort > ?", 0).Order("sort asc", true).Limit(4).Find(&partners)
	return
}